<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ page import="net.lwf.handler.util.ImageHtml, net.lwf.handler.constant.IHandlerConstant"%>
<html>
   <head>
	   <script>
		  
		  function checkAnswer() {
		  	var userans = eval('document.' + getFormName() + '.useranswer');
		  	url = '/lwf/expression.do?action=checkanswer&useranswer=' + userans.value;
		    retrieveURL(url, 'answercheckblock');
		  } 
	   </script>
   </head>
   <body>
   <html:form action="/expression" >
   <table border="0" align="center" width="100%" bordercolor="red">
       <tr>
           <td width="15%">&nbsp;</td>
           <td width="70%">
               <table border="0" width="100%">
                  <tr>
                      <td colspan="">
                         <table  width="100%" border="0">
                            <tr>
                                <td colspan="3" class="leftlabel">
                                     Question #: <bean:write name="eaform" property="questionNumber"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3" class="leftlabel">&nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="3" class="tableHeader">
                                     Compare the following expressions
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3" class="leftlabel">&nbsp;</td>
                            </tr>
                            <tr>
                                <td width="5%">&nbsp;</td>
                                <td width="90%">
                                    <table width="100%" border="0">
                                       <tr>
                                           <td width="46%" class="data" nowrap>
                                               <bean:write name="eaform" property="expdata.lhsExpression"/>
                                           </td>
                                           <td width="2%">&nbsp;</td>
                                           <td width="5%">
                                               <input type="text" style="width:50px" class="answerbox" name="useranswer"/>
                                           </td>
                                           <td width="2%">&nbsp;</td>
                                           <td width="45%" class="dataleft" nowrap>
                                               <bean:write name="eaform" property="expdata.rhsExpression"/>
                                           </td>
                                       </tr>
                                    </table>
                                </td>
                                <td width="5%">&nbsp;</td>                                
                            </tr>
                            <tr>
                                <td colspan="3" class="leftlabel">&nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="3" class="tableHeader"><hr></td>
                            </tr>
                            <tr>
                                <td colspan="3" class="tablesubheader">
                                     Enter answer and click green button to validate the answer.&nbsp;&nbsp;&nbsp;
                                     <img src="<%=request.getContextPath()%>/image/button/ok.jpg" onclick="checkAnswer()" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3">&nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="3" class="tablesubheader">
                                     For the next sum, click the next button.
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3" align="right">
                                   <a href="<%=request.getContextPath()%>/expression.do?action=compare">
                                      <%=ImageHtml.getButton(IHandlerConstant.NEXT, null)%>
                                   </a>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3" class="leftlabel">&nbsp;</td>
                            </tr>
                         </table>
                      </td>
                  </tr>                  
               </table>
           </td>
           <td width="15%">&nbsp;</td>
       </tr> 
   </table>  
   </html:form>
</body>
</html>